﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Violation_DeductList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            if (Session["Permission"] != null)
            {
                Permission permission = Session["Permission"] as Permission;
                

                Bind(permission);


            }
        }
    }

    void Bind(Permission permission)
    {
        if (Request.Params["vid"] != null)
        {
            int vid = Convert.ToInt32(Request.Params["vid"]);
            ViolationNoticeBLL vbll = new ViolationNoticeBLL(permission);
            gvCompanyDeduct.DataSource = vbll.GetCompanyDeduct(vid);
            gvCompanyDeduct.DataBind();
            gvUserDeduct.DataSource = vbll.GetStaffDeduct(vid);
            gvUserDeduct.DataBind();

        }
    }


    protected void btnReturn_Click(object sender, EventArgs e)
    {
        if (Session["Permission"] != null)
        {
            Response.Redirect("Index.aspx");
        }
    }
    protected void btnRTV_Click(object sender, EventArgs e)
    {
        if (Session["Permission"] != null && Request.Params["vid"] != null)
        {
            Response.Redirect("Details.aspx?vid=" + Request.Params["vid"]);
        }
    }
}